import {
  createRouter,
  createWebHistory,
  createWebHashHistory
} from 'vue-router'

import MyPublish from '@/components/MyPublish.vue'
import MyInfo from '@/components/MyInfo.vue'
import MyArticle from '@/components/MyArticle.vue'
import ArticleDetail from '@/components/ArticleDetail.vue'
import MyBack from '@/components/MyBack.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'articles',
      component: MyArticle
    },
    {
      path: '/mypublish',
      name: 'publish',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: MyPublish
    },
    {
      path: '/myinfo',
      name: 'info',
      component: MyInfo
    },

    {
      path: '/article/:id',
      name: 'articleDetail',
      component: ArticleDetail
    },
    {
      path: '/myback',
      name: 'myback',
      component: MyBack
    }
  ],
  linkActiveClass: 'my-custom-active-class'
})

export default router
